<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    

</head>

<body class="gray-bg">

	<div class="wrapper wrapper-content animated fadeInRight">

        <!-- Panel Other -->
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <div class="ibox-tools">
                </div>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <!-- Example Card View -->
                        <div class="example-wrap">

							<div class="example">
								<div>
									<label>全局过滤器：</label> 
									<select id="filter" style="width: 168px;height: 25px">
										<option value="0">无限制</option>
										<option value="1">全部闸机关闭</option>
										<option value="2">全部闸机常开</option>
										<option value="3">全部闸机只许进</option>
										<option value="4">全部闸机只许出</option>
									</select>
								</div>
								<div>
									<button id="saveButton">保存</button>
								</div>
							</div>
						</div>
                        <!-- End Example Card View -->
                    </div>

                </div>
            </div>
        </div>
        <!-- End Panel Other -->
		
    </div>

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="js/content.js?v=1.0.0"></script>


    <!-- Bootstrap table -->
    <script src="js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <script src="js/aivms5.js"></script>

<script>
var control_url = aivms5_control_url;   
       $("#saveButton").click(function(){
     
    	   var filterValue = $("#filter").val();
               $.ajax( {  
                   type : "POST",  
                   url : control_url + "/filter/setFilter?filter="+filterValue,  
                   success : function(data) {  
                   	if(data.code == 1000)
                   	{
                   		alert(data.msg)
                   	}
                   	else
                   	{
                   		alert(data.msg)
                   	}
                   },
                   error: function(XMLHttpRequest, textStatus, errorThrown) {
                       alert("ajax请求出错");
                   }
               });  
       })//   
       
       $.ajax( {  
           type : "GET",  
           url : control_url + "/filter/getFilter",  
           success : function(data) {  
           	if(data.code == 1000)
           	{
           		$("#filter").val(data.content);
           	}
           	else
           	{
           		alert(data.msg)
           	}
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
               alert("ajax请求出错");
           }
       });  
</script>

</body>

</html>
